{% include "header.html" %}
  <!-- Page Name -->
  <div id="page-name">
	  <div class="row">
	    <div class="twelve columns">
	      <h1>Notícias</h1>
	    </div>
	  </div>
  </div>
  
  
  <!-- Main Page Content and Sidebar -->

  <div class="row">

    <!-- Page Details -->
    <section class="eight columns">
        {% load comments %}
      <article class="post">
	      <h2>{{ news.title }}</h2>
          {% get_comment_count for news as comment_count %}
	      <span class="meta">{{ news.date }} / {{ comment_count }} Comentários</span>
	      <img src="{{ MEDIA_URL }}{{ news.imageDetach }}" />
	      <p>{{ news.content|safe }}</p>

	      
	      <div class="assinatura">
		      <p class="fonte"><b>Fonte:</b> {{ news.source }}</p>
	      </div>
	      
      </article>

      <div class="twelve columns">
  		<h2 class="cont-title"><span>Comentários</span></h2>
  	</div>
      
      <div id="comentarios">
      
	      <ul class="lista-coment">
              {% get_comment_list for news as comentarios %}
              {% for comentario in comentarios %}
		      <li>
			  	<i class="foundicon-quote"></i>
			    <p>{{ comentario.comment }}</p>
			    <span><a href="#">{{ comentario.name }}</a></span>
		      </li>
              {% endfor %}

	      </ul>

          {% get_comment_form for news as form %}
	      <div id="form-comentarios">
	      	<form method="POST" action="{% comment_form_target %}">{% csrf_token %}
	      		  <h5>Deixe seu comentário</h5>
	      		  
		          <div class="row collapse">
		            <div class="two columns"><label class="inline">Seu nome</label></div>
		            <div class="ten columns">{{ form.name }}</div>
		
		          <label>Comentário</label>
                  {{ form.content_type }}
                  {{ form.object_pk }}
		          {{ form.comment }}
                  {{ form.security_hash }}
                  {{ form.timestamp }}
                      <input type="hidden" name="next" value="{{ news.get_absolute_url }}" />
		          <button type="submit" class="radius button right">Enviar</button>
		  	</form>
	      </div>
	      
      </div>

    </section>

    <!-- End Contact Details -->


    <!-- Sidebar -->
    
    <aside class="four columns">

	    <div class="side-box">
	      <h5>Busca</h5>
	      <div class="row collapse">
	      	<form class="custom busca">
	          	<div class="eight mobile-three columns">
	            	<input type="text" placeholder="O que procura?">
	            </div>
	            <div class="four mobile-one columns">
	            	<a class="button expand postfix">Buscar</a>
	            </div>
	      	</form>
          </div>
	    </div>
	    
	    <div class="side-box">
	      <h5>Arquivos</h5>
	      <div class="row collapse">
	      	<form class="custom arquivo">
				<select style="display:none;" id="arquivos">
				  <option SELECTED>Outubro 2012</option>
				  <option>Setembro 2012</option>
				  <option>Agosto 2012</option>
				</select>
				<div class="custom dropdown">
				  <a href="#" class="current">Outubro 2012</a>
				  <a href="#" class="selector"></a>
				  <ul>
				    <li>Outubro 2012</li>
				    <li>Setembro 2012</li>
				    <li>Agosto 2012</li>
				  </ul>
				</div>
	      	</form>
          </div>
	    </div>
	    
	    <div class="side-box">
	      <h5>Últimos comentários</h5>

            <ul class="ult-coment">
            {% for news in newsAll %}
                {% get_comment_list for news as comment%}
                {% for comments in comment|slice:"-5:"%}

                    <li>
                        <i class="foundicon-quote"></i>
                        <p>{{ comments.comment }}</p>
                        <span><a href="#">{{ comments.name }}</a></span>
                    </li>
                {% endfor %}
            {% endfor %}
            </ul>
	      
	    </div>
    
    </aside>

    <!-- End Sidebar -->
  </div>

  <!-- End Main Content and Sidebar -->
{% include "footer.html" %}